package moc.tds;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;

import moc.type.DTYPE;
import moc.type.SIGNATURE;

public class INFOFUN implements INFO {
	
	private boolean isDefined ;
	private DTYPE returnType ;
	private SIGNATURE signature ;
	private int numero ;
	
	
	
	
	public boolean getIsDefined() {
		return isDefined;
	}




	public void setIsDefined(boolean isDefined) {
		this.isDefined = isDefined;
	}




	public INFOFUN(int num,DTYPE returnType, SIGNATURE signature) {
		super();
		this.numero = num  ;
		this.returnType = returnType;
		this.signature = signature;
		
	}

	
	

	public int getNumero() {
		return numero;
	}




	public void setNumero(int numero) {
		this.numero = numero;
	}




	public DTYPE getReturnType() {
		return returnType;
	}




	public SIGNATURE getSignature() {
		return signature;
	}








	public boolean equals(INFOFUN autre){
		boolean retour  ;
		
		
	
			if(!this.returnType.equals(autre.returnType)){
				retour = false ;
			}else {
				ArrayList<INFOVAR> pars =(ArrayList<INFOVAR>) autre.signature.values() ;
				ArrayList<DTYPE> types = new ArrayList<DTYPE>() ;
				for (INFOVAR par : pars) 
					types.add(par.getType()) ;
				retour = this.signature.signatureConfomes(types) ;
			}
			
		
		
		
		return retour ;
	}
	
	
	
	

}
